package com.pxst.annotations.validated;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 校验两个必须同时有值，并且第一个属性值不大于第二个属性值
 *
 * @author Txd
 * @create 2023-09-17 11:23:00
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Constraint(validatedBy = {DateValidated.class})
public @interface DateValidator {

    String message() default "起始时间不能大于结束时间";

    Class<?>[] groups() default {}; // 分组校验

    Class<? extends Payload>[] payload() default { };
}
